package com.chaosj.memory.command;

import org.springframework.shell.standard.ShellComponent;
import org.springframework.shell.standard.ShellMethod;
import org.springframework.shell.standard.ShellOption;

/**
 * @className: GuShiWenCommand
 * @description:
 * @author: caoyangjie
 * @date: 2022/3/21
 **/
@ShellComponent
public class GuShiWenCommand extends AbstractCommand{

    @ShellMethod("gsw")
    public String gsw(@ShellOption(help = "0：首页\n\t\t1: 诗文\n\t\t2:名句\n\t\t3:作者\n\t\t4:古籍\n\t\t5:词库\n\t\t6:美文") String type,
                      @ShellOption(help = "a: 作者\n\t\tt:关键词\n\t\tc:朝代") String key,
                      @ShellOption(help = "关键值") String value,
                      @ShellOption(help = "分页值") String page
                      ){
        String[] args = new String[]{"gsw", type+"", key, value, page};
        return defaultInvoke(args);
    }

    @ShellMethod("search")
    public String search(String value) {
        String[] args = new String[]{"search", value};
        return defaultInvoke(args);
    }

    @ShellMethod("searchp")
    public String searchp(String value) {
        String[] args = new String[]{"searchp", value};
        return defaultInvoke(args);
    }

}
